home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / Acere (PowerPlant, Game) 1.2 / AcereÄ.sit / Acereƒ / Code / CardWindow.cp < prev    next >
Text File  |  1995-03-04  |  2KB  |  105 lines

  1. #include "CardWindow.h"
  2. #include "CTextDoc.h"
  3. #include "WellStack.h"
  4. #include "WellFreeCell.h"
  5. #include "WellDeck.h"
  6. #include "CardDeck.h"
  7.  
  8. #include <UReanimator.h>
  9.  
  10. extern        CTextDoc    *theDoc;
  11.  
  12. CardWindow::CardWindow() : LWindow()
  13. {
  14.  
  15. }
  16.  
  17. CardWindow::CardWindow(const SWindowInfo &inWindowInfo) : LWindow(inWindowInfo)
  18. {
  19. }
  20.  
  21.  
  22. CardWindow::CardWindow(ResIDT inWINDid, Uint32 inAttributes,
  23.                     LCommander *inSuperCommander)
  24.                      : LWindow(inWINDid, inAttributes, inSuperCommander)
  25. {
  26. }
  27.  
  28.  
  29. CardWindow::CardWindow(LStream *inStream) : LWindow(inStream)
  30. {
  31. }
  32.  
  33.  
  34. CardWindow::~CardWindow()
  35. {
  36. //    LWindow::~LWindow();
  37. }
  38.  
  39.     
  40. CardWindow*    CardWindow::CreateWindow(ResIDT inWindowID,
  41.                                 LCommander *inSuperCommander)
  42. {
  43. //    CGrafPtr         theMacPort;
  44.     PixPatHandle    thePixPat;
  45.  
  46.     SetDefaultCommander(inSuperCommander);
  47.     CardWindow    *theWindow =
  48.             (CardWindow*) UReanimator::ReadObjects('PPob', inWindowID);
  49.  
  50.     thePixPat = GetPixPat(1000);
  51.     BackPixPat(thePixPat);
  52.  
  53.     theWindow->FinishCreate();
  54.  
  55. //    theMacPort = GetMacPort();
  56. //    SetPort((GrafPtr)theMacPort);
  57.     
  58.     if (theWindow->HasAttribute(windAttr_ShowNew))
  59.     {
  60.         theWindow->Show();
  61.     }
  62.     
  63.     return theWindow;
  64. }
  65.  
  66. CardWindow*    CardWindow::CreateCardWindowStream(LStream *inStream)
  67. {
  68. //    CardWindow    *theCardWindow = new  CardWindow(inStream);
  69.     return (new  CardWindow(inStream));
  70. }
  71.  
  72. void    CardWindow::DrawSelf()
  73. {
  74. //        RgnHandle        theRgnToUpdate;
  75. //        short        i;
  76.     
  77.     if (HasAttribute(windAttr_EraseOnUpdate)) {
  78.         EraseRect(&mMacWindowP->portRect);
  79.     }
  80. /*    theRgnToUpdate = NewRgn();
  81.     RectRgn(theRgnToUpdate, &mMacWindowP->portRect);
  82.     
  83.     for (i= 0; i < 4; i++)
  84.     {
  85.         DiffRgn(theRgnToUpdate, theDoc->theDeckWells[i]->GetCardRegion(), theRgnToUpdate);
  86.         DiffRgn(theRgnToUpdate, theDoc->theFreeCells[i]->GetCardRegion(), theRgnToUpdate);
  87.         DiffRgn(theRgnToUpdate, theDoc->theStacks[i]->GetCardRegion(), theRgnToUpdate);
  88.         DiffRgn(theRgnToUpdate, theDoc->theStacks[i+4]->GetCardRegion(), theRgnToUpdate);
  89.     }
  90.     
  91.     EraseRgn(theRgnToUpdate);
  92.     DisposeRgn(theRgnToUpdate);
  93.  
  94.     for (i= 0; i < 4; i++)
  95.     {
  96.         theDoc->theDeckWells[i]->Draw(0L);
  97.         theDoc->theFreeCells[i]->Draw(0L);
  98.         theDoc->theStacks[i]->Draw(0L);
  99.         theDoc->theStacks[i+4]->Draw(0L);
  100.     }
  101. */    
  102.     //    now's time to remove the other stuff    
  103. }
  104.  
  105.